package com.weiiew.backend.entity.status;

import com.weiiew.backend.entity.enums.ExecutorState;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.ArrayList;

/**
 * @author 魏锴
 * @since 2025/4/28
 */
@Data
public class ExecutorStatus {
    private ArrayList<ExecutorMessage> messages = new ArrayList<>();
    private ExecutorState state;
    private int currentIndex;

    public void addMessage(String message) {
        messages.add(new ExecutorMessage(System.currentTimeMillis(), message));
    }

    @Data
    @AllArgsConstructor
    public static class ExecutorMessage {
        private long timestamp;
        private String message;
    }
}
